package com.tt.core.cassandra.crud;

import me.prettyprint.cassandra.service.ColumnSliceIterator;
import me.prettyprint.hector.api.beans.HColumn;
import me.prettyprint.hector.api.exceptions.HectorException;

public class CRUD {

	public void create() {

	}

	// SELECT column_name FROM system.schema_columnfamilies WHERE keyspace_name
	// = X AND columnfamily_name = Y
	public void recovery() {

		ColumnSliceIterator<Integer, Double, Long> iterator = new ColumnSliceIterator<Integer, Double, Long>(
				query, startTime.getMillis(), endTime.getMillis(), false);
		iterator.hasNext(); // call hasNext first to initialize internal
							// iterator
		HColumn<Long, Double> column = iterator.next();
		
		while (iterator.hasNext()) {
			// do something
		}

	}

	public void update() {

	}

	public void delete() {

		try {
			template.deleteColumn("key", "column name");
		} catch (HectorException e) {
			// do something
		}

	}
}
